#include "GrandsonClass.h"
#include "SonClass.h"
#include "BaseClass.h"

GrandsonClass::GrandsonClass()
{

}

GrandsonClass::GrandsonClass(const GrandsonClass &g)
{

}

GrandsonClass &GrandsonClass::operator =(const GrandsonClass &g)
{
    return*this;
}

void GrandsonClass::func()
{
    BaseClass::func(); //还想调用父类的话，这里用类名称来调用~
    std::cout << "Grandson func called" << std::endl; //如果这里没有实现func，编译器会继续往上找，知道找到func的实现为止。
}

GrandsonClass::~GrandsonClass()
{
    std::cout << "Grandson class destructor called (delete grandson)." << std::endl;
}
